package com.xuxueli.applyModules.commont.testTypeToClassMethod;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 测试缓存是否有值，重启会消失
 */
public class TestConcurrenHashMapObject {
    private static Map<String, TestAbstracttest> conMap = new ConcurrentHashMap<String, TestAbstracttest>();

    public static TestAbstracttest getValue(String type){
        return conMap.get(type);
    }

    public static void setValue(String type,TestAbstracttest value){
        conMap.putIfAbsent(type,value);
    }

    public static void removeValue(String type){
        conMap.remove(type);
    }
}